package com.tech.demo.controller;

import com.tech.demo.service.HelloWorldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Api("hello world")
@RestController
@RequestMapping("/helloWorld")
public class HelloWorldController {

    @Autowired
    HelloWorldService helloWorldService;

    @ApiOperation(value = "show hello world",notes="测试 hello world" ,httpMethod="POST")
    @ResponseBody
    @RequestMapping(value = "/showHello")
    //浏览器输入：http://localhost:8080/helloWorld/showHello
    public String showHello(){
        return helloWorldService.hello();
    }

}
